home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / minix / includ~1.z / includ~1 / assert.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-10-11  |  863 b   |  39 lines

  1. /*
  2.  * assert.h
  3.  *    sec 4.2 ansi draft
  4.  */
  5.  
  6. /* Gnu derived, CopyLeft applies, see file COPYING */
  7.  
  8. /* Allow this file to be included multiple times
  9.    with different settings of NDEBUG.  */
  10. #undef assert
  11. #undef __assert
  12.  
  13. #ifdef NDEBUG
  14. #define    assert(cond)
  15.  
  16. #else
  17.  
  18. #ifdef __STDC__
  19. #  define assert(expression)  \
  20.     ((expression) ? 0 : __assert (#expression, __FILE__, __LINE__))
  21. #  define __assert(expression, file, line)  \
  22.     (__eprintf ("Failed assertion " expression        \
  23.           " at line %ld of `" file "'.\n", (long)line),    \
  24.      abort ())
  25.  
  26. #else
  27.  
  28. #  define assert(expression)  \
  29.     ((expression) ? 0 : __assert ( __FILE__, __LINE__))
  30. #  define __assert(file, line)  \
  31.     (__eprintf ("Failed assertion at line %ld of `%s'.\n", (long)line, file), \
  32.     abort ())
  33.  
  34. #endif /* __STDC__ */
  35.  
  36. void __eprintf ();        /* defined in fprintf.c */
  37.  
  38. #endif /* NDEBUG */
  39.